import axios from "axios";
import store from "@/store";
export function getAction(url, parameter) {
    return axios({
        url: url,
        method: 'get',
        params: parameter,
    })
}

export function getActionWithHeader(url, parameter) {
    return axios({
        url: url,
        method: 'get',
        params: parameter,
        headers:{
            'Authorization': store.state.token
        }
    })
}

export function postAction(url, parameter) {
    return axios({
        url: url,
        method: 'post',
        data: parameter,
    })
}

export function postActionWithHeader(url, parameter) {
    return axios({
        url: url,
        method: 'post',
        data: parameter,
        headers:{
            'Authorization': store.state.token,
            'Content-Type': 'multipart/form-data',
        }
    })
}

export function deleteActionWithHeader(url, parameter) {
    return axios({
        url: url,
        method: 'delete',
        data: parameter,
        headers:{
            'Authorization': store.state.token
        }
    })
}

